package com.chj.comp.common.rabbitmq.queue;

import com.chj.comp.common.rabbitmq.sender.MqWorkSender;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 *
 * @Description: 工作队列(一个消息只能被消费一次)：
 *
 *               / 消费者1
 * 生产者 - 队列
 *              \ 消费者2
 *
 * @author cuihui
 * @date 2022-06-09
 *
 */
@Configuration
public class MqWorkQueue {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public static final String QUEUE_NAME = "mq.work.queue";

    @Bean
    public MqWorkSender msgWorkSender() {
        return new MqWorkSender(rabbitTemplate);
    }
}
